<template>
    <app-layout title="设置">
        <view class="setting-container">
            <view class="common-form-widget-group setting">
                <view class="widget-item">
                    <text class="title">版本号</text>
                    <view class="item-content">
                        <text class="content version">v1.02</text>
                    </view>
                </view>
                <view class="widget-item" @click="toPage('/pages/member/password')">
                    <text class="title">密码管理</text>
                    <view class="item-content">
                        <text class="iconfont icon-jinru"></text>
                    </view>
                </view>
                <view class="widget-item" @click="toPage('/pages/detail/detail?type=about')">
                    <text class="title">关于我们</text>
                    <view class="item-content">
                        <text class="iconfont icon-jinru"></text>
                    </view>
                </view>
                <view class="widget-item" @click="toPage('/pages/detail/detail?type=service')">
                    <text class="title">服务协议</text>
                    <view class="item-content">
                        <text class="iconfont icon-jinru"></text>
                    </view>
                </view>
                <view class="widget-item" @click="toPage('/pages/detail/detail?type=privacy')">
                    <text class="title">隐私政策</text>
                    <view class="item-content">
                        <text class="iconfont icon-jinru"></text>
                    </view>
                </view>
            </view>
            <view class="common-save-form-btn">
                <view class="btn" @click="logout">退出账户</view>
            </view>
        </view>
    </app-layout>
</template>

<script>
import AppLayout from "@/components/layout/layout";
export default {
    name: "member-setting",
    data() {
        return {};
    },
    components: {
        AppLayout,
    },
    onLoad() {},
    onShow() {},
    onReady() {},
    onReachBottom() {},
    onPullDownRefresh() {},
    onShareTimeline() {},
    onShareAppMessage() {},
    methods: {
        toPage(url) {
            this.$utils.toPage(url);
        },
        logout() {
            this.$models.user.logout().then(() => {
                this.$utils.toast("退出成功").then(() => {
                    this.$utils.toPage("/pages/index/index", {}, "switch");
                });
            });
        },
    },
};
</script>

<style lang="less" scoped>
.setting-container {
    box-sizing: border-box;
    padding: 0 20rpx;
}
.common-form-widget-group.setting {
    padding: 0;
    background-color: #ffffff;
    .widget-item {
        padding: 36rpx 24rpx;
        border-bottom: 2rpx solid #e8e7e7;
        line-height: 30rpx;
    }
    .widget-item.last {
        border-bottom: 0;
    }
    .title {
        position: relative;
        padding: 0;
    }
    .item-content {
        display: flex;
        align-items: center;
    }
    .version {
        font-size: 28rpx;
        color: #191919;
    }
    .mobile {
        font-size: 28rpx;
        color: #c9c9c9;
        margin-right: 22rpx;
    }
}
</style>